'''
Author: @zhyy
Date: 2021-01-27 14:23:32
LastEditors: @zhyy
LastEditTime: 2021-02-06 16:51:55
'''
from app import celery

from app.tasks.send_code import send_message,send_email
from app.tasks.generate_uname import add_uname_to_redis
from app.tasks.cache_to_redis import cache_arc_sort
@celery.task()
def add(x, y):
    return x + y
    


# 发送短信验证码任务
@celery.task()
def sync_send_message():
    send_message()

# 发送邮件任务
@celery.task()
def sync_send_email():
    send_email()

@celery.task()
def sync_add_uname_to_redis():
    add_uname_to_redis()

# 异步存储数据到reids
@celery.task()
def sync_cache_arc_sort(page,per_page,index_name,data_name,k,s):
    return cache_arc_sort(page,per_page,index_name,data_name,k,s)

# celery worker -A app.tasks.task  -l info eventlet